#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main ()
{
	int i, j, k, massiv[28], kolichestvo=0;
	float procent;

	for (i=0; i<28; i++)
		massiv[i]=0;
	for (j=0; j<1000; j++)
		massiv[j%10 + (j%100-j%10)/10 + j/100 ] ++;
	for (k=0; k<28; k++)
		kolichestvo += massiv[k]*massiv[k]; 
	
	procent = (float) kolichestvo/10000; 
	
	printf ( "Vsego schastlivih biletov syshestvyet %d shtyk, \n"
		"a ih procentnoe sootnoshenie k obshemy chisly: %.5f %% \n ", kolichestvo, procent);
	system("PAUSE");
	return 0;
}